var apiPath = "http://localhost:8080/jdgl_war";
var apiMethod = "post";

var loginPath = apiPath + "/user/login";
var exitPath = apiPath + "/user/logout/secure";

var getAllRoomPath = apiPath + "/room/getRoomsByStatus/secure";
var getOneRoom = apiPath + "/room/getRoom/secure";
var getRoomDetailPath = apiPath + "/room/getRoomDetail/secure";

var getUserPath = apiPath + "/user/getUsername/secure";
var updatePWPath = apiPath + "/user/updatePassword/secure";

var openRoomPath = apiPath + "/orders/openRoom/secure";
var exitRoomPath = apiPath + "/orders/exitRoom/secure";

var updateRoomPath = apiPath + "/room/updateRoom/secure";
var deleteRoomPath = apiPath + "/room/deleteRoom/secure";

var addRoomPath = apiPath + "/room/addRoom/secure";

function rPost(urlPath,pData,fSuccess,fError){
    $.ajax({
        type:apiMethod,
        url:urlPath,
        contentType: "application/x-www-form-urlencoded;charset=utf-8",
        data:pData,
        //是否带上cookie
        xhrFields: {
            withCredentials: true
        },
        //是否可以跨域
        crossDomain: true,

        dataType: "json",
        success: fSuccess,
        error:fError
    });
}

